+2009-01-26 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkactivatable.c (gtk_activatable_do_set_related_action):
+ Block the previous action when calling reset() to prevent
+ accidental activation of the previous action.
+
+ * gtk/gtkaction.c (gtk_action_activate): Don't compare booleans.
+
+ * gtk/gtktoggleaction.c (gtk_toggle_action_set_active): Remove
+ extraneous braces.
+
2009-01-26 Bastien Nocera <hadess@hadess.net>
Bug 569240 - Crasher when using markers
{
g_return_if_fail (GTK_IS_ACTION (action));
- if (action->private_data->activate_blocked == FALSE &&
- gtk_action_is_sensitive (action))
+ if (action->private_data->activate_blocked)
+ return;
+
+ if (gtk_action_is_sensitive (action))
_gtk_action_emit_activate (action);
}
_gtk_action_remove_from_proxy_list (prev_action, GTK_WIDGET (activatable));
- g_object_unref (prev_action);
-
/* Some apps are using the object data directly...
* so continue to set it for a bit longer
*/
g_object_set_data (activatable, "gtk-action", NULL);
+
+ /*
+ * We don't want prev_action to be activated
+ * during the reset() call when syncing "active".
+ */
+ gtk_action_block_activate (prev_action);
}
/* Some applications rely on their proxy UI to be set up
*/
gtk_activatable_reset (activatable, action);
+ if (prev_action)
+ {
+ gtk_action_unblock_activate (prev_action);
+ g_object_unref (prev_action);
+ }
+
if (action)
{
g_object_ref (action);
is_active = is_active != FALSE;
if (action->private_data->active != is_active)
- {
- _gtk_action_emit_activate (GTK_ACTION (action));
- }
+ _gtk_action_emit_activate (GTK_ACTION (action));
}
/**